package com.market.goods.dao.po;

import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import tk.mybatis.mapper.entity.IDynamicTableName;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Slf4j
@ToString
@Table(name = "time_test")
//public class TimeTestPO implements Serializable, IDynamicTableName {
public class TimeTestPO implements Serializable {
    private String uid;

    @Column(name = "created_time")
    private Date createdTime;

    @Column(name = "updated_time")
    private Date updatedTime;

    private static final long serialVersionUID = 1L;

    /**
     * @return uid
     */
    public String getUid() {
        return uid;
    }

    /**
     * @param uid
     */
    public void setUid(String uid) {
        this.uid = uid == null ? null : uid.trim();
    }

    /**
     * @return created_time
     */
    public Date getCreatedTime() {
        return createdTime;
    }

    /**
     * @param createdTime
     */
    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    /**
     * @return updated_time
     */
    public Date getUpdatedTime() {
        return updatedTime;
    }

    /**
     * @param updatedTime
     */
    public void setUpdatedTime(Date updatedTime) {
        this.updatedTime = updatedTime;
    }

    int index = 0;

//    @Override
//    public String getDynamicTableName() {
//        index++;
//        if (index > 3) {
//            index = 0;
//        }
//        StringBuffer tableName = new StringBuffer(this.getClass().getAnnotation(Table.class).name());
//        String tableNameString = tableName+""+index;
//        log.info("getDynamicTableName={}",tableNameString);
//        return tableNameString;
//    }
}